// EnterDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Bloodlead.h"
#include "EnterDlg.h"


// CEnterDlg dialog

IMPLEMENT_DYNAMIC(CEnterDlg, CDialog)

CEnterDlg::CEnterDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CEnterDlg::IDD, pParent)
{

}

CEnterDlg::~CEnterDlg()
{
}

void CEnterDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CEnterDlg, CDialog)
END_MESSAGE_MAP()


// CEnterDlg message handlers

void CEnterDlg::OnOK()
{
	// TODO: Add your specialized code here and/or call the base class

	CWnd* pWnd = GetDlgItem( IDC_EDIT_ENTER );
	if( pWnd )
		pWnd->GetWindowText( mStrValue );

	if( mStrValue.IsEmpty() )
	{
		CDialog::OnCancel();
		return;
	}
	else
	{
		mfValue = _tstof( mStrValue );
		CDialog::OnOK();
	}

	CDialog::OnOK();
}

BOOL CEnterDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here
	CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT_ENTER);
	pEdit->SetWindowText( mStrValue );
	pEdit->SetSel( 0, mStrValue.GetLength() );

	return TRUE;  // return TRUE unless you set the focus to a control
}
